<?php
/**
 * @link https://www.kancloud.cn/cleverstone/ymb2
 * @copyright Copyright (c) 2020 Yii Manager Software LLC
 */

namespace frontend\controllers;

const API_SCHEMA = 'http://';
const API_DOMAIN_PREFIX = 'doc.';

/**
 * Api文档
 * @auther 荒
 * @since 1.0.0
 * @datetime 2023.11.16 09:34
 */
class ApidocController extends BaseController
{
    public $actionVerbs = ['index' => ['GET']];
    public $publicActions = ['index'];

    public function actionIndex()
    {
        if (YII_ENV_DEV) {
            // Prod env deny access
            return $this->redirect(
                API_SCHEMA . API_DOMAIN_PREFIX . $this->request->hostName
            );
        }

        return null;
    }
}